package com.taotao.proxy.service.proxy;

import com.taotao.proxy.service.OrderService;
import lombok.extern.slf4j.Slf4j;

/**
 * @Author: wangjin
 * @CreateTime: 2022-07-03  21:37
 */
@Slf4j
public class OrderServiceProxy implements OrderService {
    //代理类 到底是需要调用哪一个 被代理类
    private OrderService orderService;

    public OrderServiceProxy(OrderService orderService) {
        this.orderService = orderService;
    }

    @Override
    public String addOrder(String orderName) {
        log.info("<在adder方法之前处理 orderName:{}>", orderName);
        String resultString = orderService.addOrder(orderName);//调用被代理类
        return resultString;
    }
}
